//
//  CityActivityTotalViewController.m
//  cityStar
//
//  Created by wangjia on 14/12/14.
//  Copyright (c) 2014年 tiny. All rights reserved.
//

#import "CityActivityTotalViewController.h"
#import "HTDefine.h"
#import "ColorUtil.h"
#import "CityActivityViewController.h"
#import "CommonUtil.h"

@interface CityActivityTotalViewController ()

@end

@implementation CityActivityTotalViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"城市活动";
    
    [self setUpViews];

}

-(void)setUpViews
{
    [self addBackButton];
    self.segTitle = [[HMSegmentedControl alloc]initWithSectionTitles:@[@"我参与的活动",@"我发起的活动"]];
    
    self.segTitle.frame = CGRectMake(0, 0, KScreenWidth, 40);
    self.segTitle.backgroundColor = [UIColor whiteColor];
    self.segTitle.font = [UIFont boldSystemFontOfSize:15.0];
    self.segTitle.scrollEnabled = YES;
    self.segTitle.textColor = [ColorUtil colorFromHexRGB:@"999999"];
    self.segTitle.selectedTextColor = [ColorUtil colorFromHexRGB:@"ff5657"];
    self.segTitle.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
    self.segTitle.selectionStyle = HMSegmentedControlSelectionStyleFullWidthStripe;
    self.segTitle.selectionIndicatorHeight = 4;
    self.segTitle.segmentEdgeInset = UIEdgeInsetsMake(0, 0, 0, 0);
    self.segTitle.backgroundColor = rgba(247, 247, 247, 1);
    __weak typeof(self) weakSelf = self;
    [self.segTitle setIndexChangeBlock:^(NSInteger index) {
//                [weakSelf changeSelect:index];
    }];
    UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(0, 39, KScreenWidth, 1)];
    lbl.backgroundColor = [ColorUtil colorFromHexRGB:@"dbdbdb"];
    
    [self.view addSubview:self.segTitle];
    [self.segTitle addSubview:lbl];
    
    self.vContent.backgroundColor = [UIColor colorWithRed:0.7 green:0.7 blue:0.7 alpha:1];
    
    CityActivityViewController *viewController = (CityActivityViewController *)[CommonUtil getVCWithSbIden:@"Index" identify:@"SICityActivity"];
    [self addChildViewController:viewController];
    viewController.view.frame = self.vContent.bounds;
    [self.vContent addSubview:viewController.view];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
